package com.hermit.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hermit.system.dao.MajorInfoDao;
import com.hermit.system.entity.MajorInfoEntity;
import com.hermit.system.entity.UserInfoEntity;
import com.hermit.system.service.MajorInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("majorInfoService")
public class MajorInfoServiceImpl extends ServiceImpl<MajorInfoDao, MajorInfoEntity> implements MajorInfoService {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    /**
    * 查询数据库所有表
    */
    public List<MajorInfoEntity> queryAll () {
        List<MajorInfoEntity> allDataList = baseMapper.queryAll();
        System.out.println("查询结果:" + allDataList);
        return allDataList;
    }

    /**
    * 删除
    */
    public void delete (int id) {
        MajorInfoEntity majorInfoEntity = baseMapper.selectById(id);
        majorInfoEntity.setDeleteFlag(1);
        baseMapper.updateById(majorInfoEntity);
    }
}